import java.util.StringTokenizer;

class P10919_39643 {

       private static Scanner10919 scanner = new Scanner10919();

       public static void main(String[] args) {

               int k = scanner.getInt();

               while (k != 0) {

                       int m = scanner.getInt();

                       int[] choices = new int[k];

                       for (int i = 0; i < k; i++) {
                               choices[i] = scanner.getInt();
                       }

                       int[] categories = new int[m];

                       for (int i = 0; i < m; i++) {

                               int c = scanner.getInt();

                               int r = scanner.getInt();
                               categories[i] = r;

                               for (int j = 0; j < c; j++) {
                                       int course = scanner.getInt();

                                       if (isInChoices(course, choices)) {
                                               categories[i]--;
                                       }

                               }


                       }

                       if (meets(categories)) System.out.println("yes");
                       else System.out.println("no");


                       k = scanner.getInt();

               }

       }

       private static boolean meets(int[] categories) {
               for (int k = 0; k < categories.length; k++) {

                       if (categories[k] > 0) return false;

               }
               return true;
       }

       private static boolean isInChoices(int course, int[] choices) {
               for (int k = 0; k < choices.length; k++) {
                       if (choices[k] == course) return true;
               }
               return false;
       }

       static String readLn() {
               String newLine = System.getProperty("line.separator");
               StringBuffer buffer = new StringBuffer();
               int car = -1;
               try {
                       car = System.in.read();
                       while ((car > 0) && (car != newLine.charAt(0))) {
                               buffer.append((char) car);
                               car = System.in.read();
                       }
                       if (car == newLine.charAt(0))
                               System.in.skip(newLine.length() - 1);
               } catch (java.io.IOException e) {
                       return (null);
               }
               if ((car < 0) && (buffer.length() == 0))
                       return (null);
               return (buffer.toString()).trim();
       }

}

class Scanner10919 {

       StringTokenizer st = null;

       int getInt() {
               if (st == null)
                       st = new StringTokenizer(Reader10919.readLn());
               while (!st.hasMoreTokens())
                       st = new StringTokenizer(Reader10919.readLn());
               return Integer.parseInt(st.nextToken());
       }

}

class Reader10919 {
       static String readLn() {
               String newLine = System.getProperty("line.separator");
               StringBuffer buffer = new StringBuffer();
               int car = -1;
               try {
                       car = System.in.read();
                       while ((car > 0) && (car != newLine.charAt(0))) {
                               buffer.append((char) car);
                               car = System.in.read();
                       }
                       if (car == newLine.charAt(0))
                               System.in.skip(newLine.length() - 1);
               } catch (java.io.IOException e) {
                       return (null);
               }
               if ((car < 0) && (buffer.length() == 0))
                       return (null);
               return (buffer.toString()).trim();
       }
}
